import request from "@/utils/request";

// 获取游戏列表
export function getGameListApi(params: any) {
  return request({
    url: "/game/get_game_list",
    method: "get",
    params,
  });
}

// 新增游戏
export function addGameApi(data: any) {
  return request({
    url: "/game/add_game",
    method: "post",
    data,
  });
}

// 获取游戏详情
export function getGameInfoApi(id: any) {
  return request({
    url: "/game/get_game",
    method: "get",
    params: { id },
  });
}

// 更新游戏详情
export function updateGameApi(data: any) {
  return request({
    url: "/game/update_game",
    method: "put",
    data,
  });
}

// 新增游戏下载链接
export function addGameDownloadApi(data: any) {
  return request({
    url: "/game_download_link/add_game_download_link",
    method: "get",
    data,
  });
}

// 查询游戏下载链接
export function getGameDownloadApi(gameId: any) {
  return request({
    url: "/game_download_link/get_game_download_link",
    method: "get",
    params: { gameId },
  });
}
